package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("project_user")
@Schema(description = "项目用户关系表")
public class ProjectUser extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Schema(description = "用户Id")
    private Long id;

    @Schema(description = "用户id")
    @TableField("user_id")
    @JsonProperty("userId")
    private Long userId;

    @Schema(description = "项目id")
    @TableField("project_id")
    @JsonProperty("projectId")
    private Long projectId;

    @Schema(description = "是否自己创建")
    @TableField("is_create")
    @JsonProperty("isCreate")
    private Integer isCreate;

    @Schema(description = "是否收藏")
    @TableField("is_collection")
    @JsonProperty("isCollection")
    private Integer isCollection;

    @Schema(description = "是否置顶")
    @TableField("is_top")
    @JsonProperty("isTop")
    private Integer isTop;

    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
